<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:p="http://primefaces.prime.com.tr/ui">

 
	<ui:composition template="/templates/common/content.xhtml">
		<ui:define name="pageTitle">Registration Page</ui:define>
		<ui:define name="body">
	<div class="container_24">
		<div class="wrapper">
			<ui:include src="/templates/common/login_sidebar.xhtml"></ui:include>
					
			<div class="grid_17">
				<div class="inside">
				<h:panelGroup rendered="#{!mAccount.loggedIn}">
					<article>
						<header>
							<h2>Registration</h2>
						</header>
						<div class="content">
						<h:form id="registration-form">
							<rich:graphValidator id="dupEmail">
								<table width="100%" cellspacing="5" cellpadding="0" border="0" class="table_box">
									<tbody>
										<tr>
											<td align="right" width="200px">Your Email:</td>
											<td>
												<h:inputText value="#{registrationBean.acc.email}" id="acc_email" validator="#{mValidatorLib.EmailValidate}"/>
												
												<div class="table_td_message">
												<rich:message for="acc_email" />
												</div>
											</td>
										</tr>
										<tr>
											<td align="right" width="200px">Password:</td>
											<td>
												<h:inputSecret value="#{registrationBean.acc.password}" id="acc_password" validator="#{mValidatorLib.PasswordValidate}"/>
												<div class="table_td_message">
												<rich:message for="acc_password" />
												</div>
											</td>
										</tr>
										<tr>
											<td align="right" width="200px">Confirm Password:</td>
											<td>
												<h:inputSecret value="#{registrationBean.confirm_password}" id="confirm_password" validator="#{mValidatorLib.PasswordValidate}"/>
												<div class="table_td_message">
												<rich:message for="confirm_password" />
												</div>
											</td>
										</tr>
										<tr>
											<td align="right" width="200px">Security Question*:</td>
											<td>
												<h:selectOneMenu value="#{registrationBean.acc.question}">
													<f:selectItem itemLabel="What is your ID card number ?" itemValue="What is your ID card number ?"/>	
													<f:selectItem itemLabel="What is your mother's middle name ?" itemValue="What is your mother's middle name ?" />
													<f:selectItem itemLabel="What is your lover name ?"	itemValue="What is your lover name ?" />	
													<f:selectItem itemLabel="What is your favorite pet ?" itemValue="What is your favorite pet ?" />	
												</h:selectOneMenu>
										
												<div class="table_td_message">
												
												</div>
											</td>
										</tr>
										<tr>
											<td align="right" width="200px">Your answer*:</td>
											<td>
												<h:inputText value="#{registrationBean.acc.answer}" id="acc_answer" validator="#{mValidatorLib.SecurityAnswerValidator}"/>
												<div class="table_td_message">
												<rich:message for="acc_answer" />
												</div>
											</td>
										</tr>
									</tbody>
								</table>		
							</rich:graphValidator>
							
							<h3>Basic Information</h3>
							<table width="100%" cellspacing="5" cellpadding="0" border="0" class="table_box">
									<tbody>
										<tr>
											<td align="right"></td>
											<td>
												
												<div class="table_td_message"><rich:message for="uinfo" /></div>
											</td>
										</tr>
										<tr>
											<td align="right"  width="200px">Fullname*:</td>
											<td>
												<h:inputText value="#{registrationBean.acc.name}" id="acc_name" validator="#{mValidatorLib.FullnameValidator}"/>
												<div class="table_td_message"><rich:message for="acc_name"> </rich:message></div>
											</td>
										</tr>
										<tr>
											<td align="right">Country*:</td>
											<td>
												<h:selectOneMenu value="#{registrationBean.acc.country}" id="acc_country">
														<f:selectItem itemValue="Australia" itemLabel="Australia" />
												</h:selectOneMenu>
												<div class="table_td_message"><rich:message for="acc_country" /></div>
											</td>
										</tr>
										<tr>
											<td align="right">State*:</td>
											<td>
												<h:selectOneMenu value="#{registrationBean.acc.state}" id="acc_state">
																<f:selectItem itemValue="Sydney" itemLabel="Sydney" />
																<f:selectItem itemValue="Brisbane" itemLabel="Brisbane" />
																<f:selectItem itemValue="Adelaide" itemLabel="Adelaide" />
																<f:selectItem itemValue="Melbourne" itemLabel="Melbourne" />
																<f:selectItem itemValue="Perth" itemLabel="Perth" />
												</h:selectOneMenu> 
												<div class="table_td_message"><rich:message for="acc_state" /></div>
											</td>
										</tr>
										<tr>
											<td align="right">Address*:</td>
											<td>
												<h:inputText value="#{registrationBean.acc.address}" id="acc_address" validator="#{mValidatorLib.AddressValidator}" />
												<div class="table_td_message"><rich:message for="acc_address" /></div>
											</td>
										</tr>
										<tr>
											<td align="right">Phone*:</td>
											<td>
												<h:inputText value="#{registrationBean.acc.phone}" id="acc_phone" validator="#{mValidatorLib.PhoneValidator}"/>
												<div class="table_td_message"><rich:message for="acc_phone" /></div>
											</td>
										</tr>
									</tbody>
								</table>
		
							<h3>Account Information</h3>
							<table width="100%" cellspacing="5" cellpadding="0" border="0" class="table_box">
					<tbody>
						<tr>
							<td align="right" width="200px;"></td>
							<td>
								<div class="table_td_message"><rich:message for="regisinfo" /></div>
							</td>
						</tr>
						<tr>
							<td align="right">ID Number*: </td>
							<td>
								<h:inputText value="#{registrationBean.acc.IDNumber}" id="user_id_num" validator="#{mValidatorLib.IDNumberValidator}"/>
								<div class="table_td_message"><rich:message for="user_id_num" /></div>
							</td>
						</tr>
						<tr>
							<td align="right"></td>
							<td><h:commandLink action="#{registrationBean.addNewAccount}" styleClass="button" value="Complete My Registraion" /></td>
						</tr>
				</tbody>
			</table>
						</h:form>
						
						</div>
					</article>
				</h:panelGroup>
				<h:panelGroup rendered="#{mAccount.loggedIn}">
					<h6>You are currently logged in !</h6>
				</h:panelGroup>
				</div>
			</div>
		</div>
	</div>
</ui:define>
</ui:composition>
</html>
